package com.cxm.weilai.producer;

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Chenman
 * @create 2019/5/9
 * @since 1.0.0
 */

import kafka.producer.Partitioner;
import kafka.utils.VerifiableProperties;

public class MyPartitioner implements Partitioner {

    public MyPartitioner() {

    }

    public MyPartitioner(VerifiableProperties props) {

    }

    /*
     * @see kafka.producer.Partitioner#partition(java.lang.Object, int)
     */
    @Override
    public int partition(Object key, int partitionCount) {
        return Integer.valueOf((String) key) % partitionCount;
    }
}